home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_shark.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  120 lines

  1. # Jones 3D Cog Script
  2. #
  3. # actor_Shark.cog
  4. #
  5. # [RT] [MDR]
  6. #
  7. # Animates ultra-cool shark mat cels in the following order:
  8. #    Type 1: 1, 0, 2, 0.  FPS = 3.0
  9. #    Type 2: 0, 2, 0, 1.  FPS = 3.5
  10. #    Type 3: 2, 1, 0, 1.  FPS = 4.0
  11. #
  12. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  13. #
  14. # ========================================================================================
  15.  
  16. symbols
  17.  
  18.     message        created
  19.     message        sighted
  20.     message        timer
  21.    
  22. # ************************** TEMPLATES *************************
  23.     material    skin1=shsd.mat
  24.     material    skin2=shsd2.mat
  25.     material    skin3=shsd3.mat
  26.  
  27. # ************************** MISC LOCAL VARS *******************
  28.     int            n_animT1=0            local
  29.     int            n_animT2=0            local
  30.     int            n_animT3=0            local
  31.  
  32.     int            T1cel0=1            local
  33.     int            T1cel1=0            local
  34.     int            T1cel2=2            local
  35.     int            T1cel3=0            local
  36.  
  37.     int            T2cel0=0            local
  38.     int            T2cel1=2            local
  39.     int            T2cel2=0            local
  40.     int            T2cel3=1            local
  41.  
  42.     int            T3cel0=2            local
  43.     int            T3cel1=1            local
  44.     int            T3cel2=0            local
  45.     int            T3cel3=1            local
  46.  
  47. end
  48.  
  49.  
  50. # ========================================================================================
  51. code
  52.  
  53. # ...................................................................
  54. created:
  55.  
  56.     AISetSubMode(GetSenderRef(), 0x80);                # Set SUBMODE_NOMOVEBACKWARDS
  57.     AISetSubMode(GetSenderRef(), 0x20000);            # Set SUBMODE_SEMICONTINUOUSMOTION
  58.     AISetSubMode(GetSenderRef(), 0x200000);            # Set SUBMODE_SWIMNEARSURFACE
  59.         
  60.     return;
  61.  
  62.  
  63. # ...................................................................
  64. sighted:
  65.  
  66.     if ( IsThingModelName(GetSenderRef(), "gen_sh.3do") )
  67.     {
  68.         SetTimerEx(0.333, 1, 0, 0);
  69.     }
  70.     else if ( IsThingModelName(GetSenderRef(), "gen_sh2.3do") )
  71.     {
  72.         SetTimerEx(0.286, 2, 0, 0);
  73.     }
  74.     else if( IsThingModelName(GetSenderRef(), "gen_sh3.3do") )
  75.     {
  76.         SetTimerEx(0.250, 3, 0, 0);
  77.     }
  78.  
  79.     return;
  80.  
  81.  
  82. # ...................................................................
  83. timer:
  84.  
  85.     if ( GetSenderID() == 1 )
  86.     {
  87.         SetMaterialCel(skin1, T1cel0[n_animT1]);
  88.  
  89.         n_animT1 = n_animT1 + 1;
  90.         if ( n_animT1 > 3 )
  91.             n_animT1 = 0;
  92.  
  93.         SetTimerEx(0.333, 1, 0, 0);
  94.     }
  95.     else if ( GetSenderID() == 2 )
  96.     {
  97.         SetMaterialCel(skin2, T2cel0[n_animT2]);
  98.  
  99.         n_animT2 = n_animT2 + 1;
  100.         if ( n_animT2 > 3 )
  101.             n_animT2 = 0;
  102.  
  103.         SetTimerEx(0.286, 2, 0, 0);
  104.     }
  105.     else if ( GetSenderID() == 3 )
  106.     {
  107.         SetMaterialCel(skin3, T3cel0[n_animT3]);
  108.  
  109.         n_animT3 = n_animT3 + 1;
  110.         if ( n_animT3 > 3 )
  111.             n_animT3 = 0;
  112.  
  113.         SetTimerEx(0.250, 2, 0, 0);
  114.     }
  115.  
  116.     return;
  117.  
  118. end
  119.  
  120.